package demo;

public class Person {
    private String name;
    private String gender;
    private int age;

    public Person(String name) {
        this.name = name;
    }

    public Person(String name, String gender) {
        this.name = name;
        this.gender = gender;
    }

    public Person(String name, String gender, int age) {
        this.name = name;
        this.gender = gender;
        this.age = age;
    }



    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return this.name + ", " + this.gender + ", " + this.age;
    }

    public static void main(String[] args) {
        Person person = new Person("Tom", "male", 20);
        System.out.println(person);
        person.setName("Jerry");
        person.setGender("female");
        person.setAge(19);
        System.out.println(person);

        Person p1 = new Person("Jerry");
        Person p2 = new Person("Tom", "male");
        System.out.println(p1);
        System.out.println(p2);
    }
}
